#-*- coding:utf-8 -*-
'''
Created on 2013-6-26

@author: hanjiewu
'''
import json
import os
from StringIO import StringIO
f = open(r"C:\Users\hanjiewu\Desktop\20130626-trustgo-infos.txt", 'r')

print json.JSONEncoder().encode({'a':'焊接无'})
print {'a':'焊接无'}.__str__()
v = StringIO()
v.write('{')
m = {'a':'焊接无'}
for key in m:
    v.write("'%s':'%s'" % (key, m[key]))
    v.write(',')
if len(v.getvalue()) > 1:
    v.seek(-1, os.SEEK_END)
v.write('}')
print v.getvalue()
